package com.frp.config;

import java.util.List;
import java.util.Map;

/**
 * FRP客户端配置类
 */
public class FrpcConfig {
    private CommonConfig common;
    private List<ProxyConfig> proxies;
    
    public CommonConfig getCommon() {
        return common;
    }
    
    public void setCommon(CommonConfig common) {
        this.common = common;
    }
    
    public List<ProxyConfig> getProxies() {
        return proxies;
    }
    
    public void setProxies(List<ProxyConfig> proxies) {
        this.proxies = proxies;
    }
    
    /**
     * 通用配置
     */
    public static class CommonConfig {
        private String serverAddr;
        private int serverPort = 7000;
        private String token;
        private String authMethod = "token";
        private int poolCount = 1;
        private boolean tlsEnable = true;
        private String logLevel = "info";
        private String logFile = "./frpc.log";
        private boolean tcpMux = true;
        private int heartbeatInterval = 30;
        private int heartbeatTimeout = 90;
        
        // Getters and Setters
        public String getServerAddr() { return serverAddr; }
        public void setServerAddr(String serverAddr) { this.serverAddr = serverAddr; }
        
        public int getServerPort() { return serverPort; }
        public void setServerPort(int serverPort) { this.serverPort = serverPort; }
        
        public String getToken() { return token; }
        public void setToken(String token) { this.token = token; }
        
        public String getAuthMethod() { return authMethod; }
        public void setAuthMethod(String authMethod) { this.authMethod = authMethod; }
        
        public int getPoolCount() { return poolCount; }
        public void setPoolCount(int poolCount) { this.poolCount = poolCount; }
        
        public boolean isTlsEnable() { return tlsEnable; }
        public void setTlsEnable(boolean tlsEnable) { this.tlsEnable = tlsEnable; }
        
        public String getLogLevel() { return logLevel; }
        public void setLogLevel(String logLevel) { this.logLevel = logLevel; }
        
        public String getLogFile() { return logFile; }
        public void setLogFile(String logFile) { this.logFile = logFile; }
        
        public boolean isTcpMux() { return tcpMux; }
        public void setTcpMux(boolean tcpMux) { this.tcpMux = tcpMux; }
        
        public int getHeartbeatInterval() { return heartbeatInterval; }
        public void setHeartbeatInterval(int heartbeatInterval) { this.heartbeatInterval = heartbeatInterval; }
        
        public int getHeartbeatTimeout() { return heartbeatTimeout; }
        public void setHeartbeatTimeout(int heartbeatTimeout) { this.heartbeatTimeout = heartbeatTimeout; }
    }
    
    /**
     * 代理配置
     */
    public static class ProxyConfig {
        private String name;
        private String type;  // tcp, udp, http, https
        private String localIp = "127.0.0.1";
        private int localPort;
        private int remotePort;
        private boolean useEncryption = false;
        private boolean useCompression = false;
        private String[] customDomains;
        private String subdomain;
        private String httpUser;
        private String httpPwd;
        private Map<String, String> headers;
        private String group;
        private String groupKey;
        
        // Getters and Setters
        public String getName() { return name; }
        public void setName(String name) { this.name = name; }
        
        public String getType() { return type; }
        public void setType(String type) { this.type = type; }
        
        public String getLocalIp() { return localIp; }
        public void setLocalIp(String localIp) { this.localIp = localIp; }
        
        public int getLocalPort() { return localPort; }
        public void setLocalPort(int localPort) { this.localPort = localPort; }
        
        public int getRemotePort() { return remotePort; }
        public void setRemotePort(int remotePort) { this.remotePort = remotePort; }
        
        public boolean isUseEncryption() { return useEncryption; }
        public void setUseEncryption(boolean useEncryption) { this.useEncryption = useEncryption; }
        
        public boolean isUseCompression() { return useCompression; }
        public void setUseCompression(boolean useCompression) { this.useCompression = useCompression; }
        
        public String[] getCustomDomains() { return customDomains; }
        public void setCustomDomains(String[] customDomains) { this.customDomains = customDomains; }
        
        public String getSubdomain() { return subdomain; }
        public void setSubdomain(String subdomain) { this.subdomain = subdomain; }
        
        public String getHttpUser() { return httpUser; }
        public void setHttpUser(String httpUser) { this.httpUser = httpUser; }
        
        public String getHttpPwd() { return httpPwd; }
        public void setHttpPwd(String httpPwd) { this.httpPwd = httpPwd; }
        
        public Map<String, String> getHeaders() { return headers; }
        public void setHeaders(Map<String, String> headers) { this.headers = headers; }
        
        public String getGroup() { return group; }
        public void setGroup(String group) { this.group = group; }
        
        public String getGroupKey() { return groupKey; }
        public void setGroupKey(String groupKey) { this.groupKey = groupKey; }
    }
}